import requests
import execjs


with open('./parse/3.烯牛数据.js', 'r') as f:
    js_str = f.read()
    js_code = execjs.compile(js_str)




d_payload = {
    "libraryId": 33,
    "sectionId": 208,
    "filterConfigIds": [
        271,
        269,
        270,
        1404,
        889,
        305,
        272,
        266,
        1825,
        267,
        268,
        1162
    ],
    "queryParam": {
        "start": 0,
        "limit": 20,
        "searchFieldIds": None,
        "is_oversea": [
            "1",
            "2",
            "3",
            "4"
        ],
        "query_field_ids": None
    }
}

json_data = js_code.call("get_json_data", d_payload)
print(json_data)



res = requests.post('https://vip.xiniudata.com/api/vip/library/v3/init',json=json_data)

d = res.json()['d']
# print(d)
data = js_code.call("parse_d", d)
print(data)





